package com.yequan.thread.threadpool.mythreadpoolmanager;


/**
 * 单线程线程池
 *
 * @author yequan
 * @date 2019/12/02
 */
public class SingleThreadPoolManager {

    /**
     * SingleThreadPoolManager实例对象
     */
    private static SingleThreadPoolManager singleThreadPoolManager = new SingleThreadPoolManager();
    /**
     * 线程池对象
     */
    private CustomThreadPoolManager customThreadPoolManager;

    /**
     * SingleThreadPoolManager构造方法
     */
    private SingleThreadPoolManager() {
        customThreadPoolManager = new CustomThreadPoolManager(1, 1);
    }

    /**
     * 获取全局唯一实例
     *
     * @return
     */
    public static SingleThreadPoolManager getInstance() {
        return singleThreadPoolManager;
    }

    /**
     * 获取线程池管理对象
     *
     * @return
     */
    public CustomThreadPoolManager getCustomThreadPoolManager() {
        return customThreadPoolManager;
    }

}
